/**
 * 文件下载进程状态管理
 */

const state = {
    progressList: []  // 文件下载进度列表
}

const getters = {}

const actions = {}

const mutations = {
    ADD_PROGRESS: (state,progressObj) => {
        if (state.progressList.length) { // 下载进度列表存在
            console.log("🌸 >> 下载列表存在", state.progressList)
        }else {
            state.progressList.push(progressObj)
        }
    },

    DEL_PROGRESS: (state,props) => {
        state.progressList.splice(state.progressList.findIndex(item => item.path == props),1)
    }
}

export default {
    state,
    getters,
    actions,
    mutations
}

